using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace Cmc.Modbus.Base
{
     public enum LogLevel : byte
    {
        /// <summary>打开所有日志记录</summary>
        All = 0,
        /// <summary>最低调试。细粒度信息事件对调试应用程序非常有帮助</summary>
        Debug = 1,
        /// <summary>普通消息。在粗粒度级别上突出强调应用程序的运行过程</summary>
        Info = 2,
        /// <summary>警告</summary>
        Warn = 3,
        /// <summary>错误</summary>
        Error = 4,
        /// <summary>严重错误</summary>
        Fatal = 5,
        /// <summary>关闭所有日志记录</summary>
        Off = 255, // 0xFF
    }

    public interface ILog
    {
 
            /// <summary>写日志</summary>
            /// <param name="level">日志级别</param>
            /// <param name="format">格式化字符串</param>
            /// <param name="args">格式化参数</param>
            void Write(LogLevel level, string format, params object?[] args);

            /// <summary>调试日志</summary>
            /// <param name="format">格式化字符串</param>
            /// <param name="args">格式化参数</param>
            void Debug(string format, params object?[] args);

            /// <summary>信息日志</summary>
            /// <param name="format">格式化字符串</param>
            /// <param name="args">格式化参数</param>
            void Info(string format, params object?[] args);

            /// <summary>警告日志</summary>
            /// <param name="format">格式化字符串</param>
            /// <param name="args">格式化参数</param>
            void Warn(string format, params object?[] args);

            /// <summary>错误日志</summary>
            /// <param name="format">格式化字符串</param>
            /// <param name="args">格式化参数</param>
            void Error(string format, params object?[] args);

            /// <summary>严重错误日志</summary>
            /// <param name="format">格式化字符串</param>
            /// <param name="args">格式化参数</param>
            void Fatal(string format, params object?[] args);
        }
}
